import request from '@/utils/http'

export class DictService {
	static pages(params:any) {
	  return request.post<any>({
	    url: '/sys/dict/pages',
		params
	  })
	}
	
	static getLoadAll(params:any) {
	  return request.post<any>({
	    url: '/sys/dict/load/all',
		params
	  })
	}
	
	static getLoadLazy(params:any) {
	  return request.post<any>({
	    url: '/sys/dict/load/lazy',
		params
	  })
	}
	
	static options(params:any) {
	  return request.post<any>({
	    url: '/sys/dict/select/treey',
		params
	  })
	}
	
	static save(params:any) {
	  return request.post<any>({
	    url: '/sys/dict/save',
		params
	  })
	}
	
	static delete(id:string) {
	  return request.del<any>({
	    url: '/sys/dict/detain/'+id,
	  })
	}
	
	static getItemPages(params:any) {
	  return request.post<any>({
	    url: '/sys/dict/item/pages',
		params
	  })
	}
	
	static saveItem(params:any) {
	  return request.post<any>({
	    url: '/sys/dict/item/save',
		params
	  })
	}
	
	static deleteItem(id:string) {
	  return request.del<any>({
	    url: '/sys/dict/item/detain/'+id,
	  })
	}
	
	static getMappings() {
	  return request.get<any>({
	    url: '/sys/dict/mappings',
	  })
	}
	
	static getSelectOptions(code:string) {
	  return request.get<any>({
	    url: '/sys/dict/options/'+code,
	  })
	}
	
}

